tinyredis_util.util

Undocumented in source.

Members

Functions

btr
bool btr(Redis redis, string key, uint bitnum)

Tests and resets (sets to 0) the bit.

bts
bool bts(Redis redis, string key, uint bitnum)

Tests and sets (sets to 1) the bit.

camelCaseToSnake
string camelCaseToSnake(string s)

Convert a lower camelcase string to snake case. We can't use regex to match at compile-time so we'll iterate through the string and convert it manually.

conv
T conv(string input)

Convert a string into T type.

copyToRedis
void copyToRedis(T source, Redis target, string prefix)

Copy a structure into Redis variables.

copyToStruct
void copyToStruct(Redis redis, T target, string prefix)

Copy the values of the Redis variables into a structure.

get
T get(Redis redis, string key)

Get a Redis variable

getBit
bool getBit(Redis redis, string key, uint offset)

Returns the bit value at offset in the string value stored at key.

hget
T hget(Redis redis, string key, string field)

Returns the value associated with field in the hash stored at key.

psetex
void psetex(Redis redis, string key, int milliseconds, T value)

psetex works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.

respTo
T respTo(Response response)

Safe convert Response

set
void set(Redis redis, string key, T value)

Set a Redis variable.

setBit
void setBit(Redis redis, string key, uint offset, bool value)

Sets or clears the bit at offset in the string value stored at key. The bit is either set or cleared depending on value, which can be either 0 or 1.

setex
void setex(Redis redis, string key, int seconds, T value)

Set key to hold the string value and set key to timeout after a given number of seconds

Templates

commonType
template commonType(T)
Undocumented in source.

Meta